1. Field of the Invention
The invention generally relates to peer-to-peer communications and, more particularly, to an apparatus and method for providing peer-to-peer proxy services in peer-to-peer communications.
2. Description of the Related Art
In recent years, peer-to-peer applications, such as BitTorrent and eMule, have become increasingly popular. Users from around the world can conveniently download and share all kinds of files. In a conventional downloading scenario, there is only one uploading user for several other users to download a shared file. Thus, the upstream bandwidth of the uploading user can easily become bottlenecked when the number of downloading users increases. Additionally, when bottlenecks occur, the system resources and the network bandwidth of the uploading user may become insufficient. On the other hand, in a peer-to-peer application, take BitTorrent as an example, every downloading user is also uploading the shared file so that the uploading task may be distributed to every user. In this case, every user can benefit from increasing connection sources when there are more users sharing the same shared file.
In spite of the above mentioned benefits, the number of connections established by peer-to-peer applications is far more than that by other applications. This results in a huge burden on network gateway devices, especially the broadband gateway devices for households and small/medium sized enterprises. In a private network, each computer connected to a network gateway is assigned a private network address. When a computer in the private network tries to establish a connection to the public network, the network gateway performs the network address translation (NAT) procedure to replace the private network address with the public network address of the network gateway. During the NAT procedure, the network gateway creates a NAT table for storing the mapping information of every incoming and outgoing connection, including a source IP, a source port number, a destination IP, a destination port number, a mangled IP, a mangled port number, etc. FIG. 1 is a block diagram illustrating the NAT table of a network gateway. As shown in FIG. 1, the source and destination of every incoming and outgoing connection needs to be identified by the NAT procedure (by looking up the NAT table). As the number of connections increases, the NAT procedure occupies more and more system resources of the network gateway. This will cause the efficiency of the network gateway to drop significantly.
FIG. 2 is a block diagram illustrating BitTorrent communications through a network gateway device. In FIG. 2, a computer 221 in a private network 220 first downloads a torrent file 201 from a public network 210. The network address of a public tracker 212 and the information of the shared contents are included in the torrent file 201. The computer 221 sends an inquiry message to the public tracker 212 to ask for the list of computers that are sharing the shared contents. In the feedback of the public tracker 212, the computer 221 recognizes that a computer 211 is sharing the shared contents. The computer 221 further establishes a connection with the computer 211 to download the shared contents. The information of the connection is maintained, by the network gateway device 230, in a NAT table 231.